import axios from 'axios'
export default {
  namespaced: true,
  state: {
    token: '',
    userInfo: {}
  },
  mutations: {
    updateToken(state, payload) {
      state.token = payload
    },
    ji(state, shuju) {
      state.userInfo = shuju
    }
  },
  getters: {},
  actions: {
    async updateUser(context) {
      const { data: res } = await axios.get('/my/userinfo')
      console.log(res)
      if (res.code !== 0) return
      context.commit('ji', res.data)
    }
  }
}
